Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: do not return default service if config.service was user set and equals inferred service [backport 3.1] #12502

Open
wants to merge 2 commits into
base: 3.1
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

Backport 38301c9 from #12490 to 3.1.

Motivation

Fixes small edge case for service naming, where if the user-provided service equals the inferred base service, the code returns default service name, even though the actual service name should be returned in this case. Adds a check to see if the service name was user provided.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

…nd equals inferred service (#12490)

## Motivation

Fixes small edge case for service naming, where if the user-provided
service equals the inferred base service, the code returns default
service name, even though the actual service name should be returned in
this case. Adds a check to see if the service name was user provided.

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

(cherry picked from commit 38301c9)
@github-actions github-actions bot requested a review from a team as a code owner February 24, 2025 22:08
@github-actions github-actions bot added the changelog/no-changelog A changelog entry is not required for this PR. label Feb 24, 2025
@github-actions github-actions bot requested a review from juanjux February 24, 2025 22:08
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Feb 24, 2025

Datadog Report

Branch report: backport-12490-to-3.1
Commit report: cdb2835
Test service: dd-trace-py

✅ 0 Failed, 43 Passed, 460 Skipped, 59.19s Total duration (9m 39.54s time saved)

@pr-commenter
Copy link

pr-commenter bot commented Feb 24, 2025

Benchmarks

Benchmark execution time: 2025-02-26 20:04:30

Comparing candidate commit cdb2835 in PR branch backport-12490-to-3.1 with baseline commit cf224f4 in branch 3.1.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 418 metrics, 2 unstable metrics.

@wconti27 wconti27 self-requested a review February 25, 2025 14:55
@wconti27 wconti27 enabled auto-merge (squash) February 25, 2025 18:54
auto-merge was automatically disabled February 26, 2025 19:17

Pull request was closed

@erikayasuda erikayasuda reopened this Feb 26, 2025
Copy link
Contributor Author

CODEOWNERS have been resolved as:

ddtrace/settings/_config.py                                             @DataDog/apm-core-python
tests/internal/service_name/test_inferred_base_service.py               @DataDog/apm-core-python

@erikayasuda erikayasuda enabled auto-merge (squash) February 26, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants